package com.itheima.hmshopping.dubbo.apiImpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.hmshopping.dubbo.api.UmsRoleServiceApi;
import com.itheima.hmshopping.dubbo.mapper.UmsRoleMapper;
import com.itheima.hmshopping.entity.UmsRole;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class UmsRoleServiceApiImpl implements UmsRoleServiceApi {

    @Autowired
    private UmsRoleMapper umsRoleMapper;


    /**
     * 根据roleId查看
     *
     * @param roleId
     * @return
     */
    @Override
    public UmsRole selectId(Long roleId) {
        return umsRoleMapper.selectById(roleId);
    }

    /**
     * 查所有
     * @return
     */
    @Override
    public List<UmsRole> selectAll() {
        LambdaQueryWrapper<UmsRole> wrapper=new LambdaQueryWrapper<>();
        return umsRoleMapper.selectList(wrapper);
    }
}
